#ifndef MainWindowFleetTest_H
#define MainWindowFleetTest_H

#include <QMainWindow>
#include <QTimer>
#include "protocolcodeing.h"
class QTcpSocket;


namespace Ui {
class MainWindow;
}

class MainWindowFleetTest : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindowFleetTest(QWidget *parent = 0);
    ~MainWindowFleetTest();
private slots:
    void timeOut_slot();
    void on_pushButton_clicked();

    void on_pushButton_disconnect_clicked();

    void on_pushButton_send_clicked();

    void on_pushButton_receiveOnce_clicked();

    void on_pushButton_clearText_clicked();

    void on_pushButton_clearAllPath_clicked();

    void on_pushButton_addPath_clicked();

    void on_pushButton_setForkHeight_clicked();

    void on_pushButton_pause_clicked();

    void on_pushButton_stop_clicked();

    void on_pushButton_start_clicked();



    void on_pushButton_clearMessage_clicked();

    void on_pushButton_addMusic_clicked();

    void on_pushButton_addMusic_2_clicked();

    void on_pushButton_setVel_clicked();


    void on_pushButton_setCharge_clicked();

    void on_pushButton_setLift_clicked();

    void on_pushButton_setRoller_clicked();

    void on_pushButton_addPath_complex_clicked();

    void on_pushButton_calculateValue_clicked();

    void on_pushButton_calculateBuma_clicked();

    void on_pushButton_addRobotArmCommand_clicked();

    void on_pushButton_addAutoDrive_clicked();

private:
    int processBasicInfo(QByteArray tmpBufferIn);
    int processMessageInfo(QByteArray tmpBufferIn);
    int receiveProcess();
    int connectServer(QString ip, int port);
    int disconnectServer();
    int displayAgvBasicInfo();
    int sendAgvCommand(QByteArray agvCommand);
    int receiveSocketBuffer(QByteArray &bufferOut);
    int waitReply(int timeOut);

private:
    Ui::MainWindow *ui;
    QTcpSocket *clientSocket;
    QTimer timer;
    ProtocolCodeing *protocolCodeing;
};

#endif // MainWindowFleetTest_H
